3.3.77 \(\int \frac {\cos (x)}{(a-a \sin ^2(x))^2} \, dx\) [277]

Optimal. Leaf size=22 \[ \frac {\tanh ^{-1}(\sin (x))}{2 a^2}+\frac {\sec (x) \tan (x)}{2 a^2} \]

[Out]

1/2*arctanh(sin(x))/a^2+1/2*sec(x)*tan(x)/a^2

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 22, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.214, Rules used = {3254, 3853, 3855} \begin {gather*} \frac {\tanh ^{-1}(\sin (x))}{2 a^2}+\frac {\tan (x) \sec (x)}{2 a^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cos[x]/(a - a*Sin[x]^2)^2,x]

[Out]

ArcTanh[Sin[x]]/(2*a^2) + (Sec[x]*Tan[x])/(2*a^2)

Rule 3254

Int[(u_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> Dist[a^p, Int[ActivateTrig[u*cos[e + f*x
]^(2*p)], x], x] /; FreeQ[{a, b, e, f, p}, x] && EqQ[a + b, 0] && IntegerQ[p]

Rule 3853

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d*x]*((b*Csc[c + d*x])^(n - 1)/(d*(n
- 1))), x] + Dist[b^2*((n - 2)/(n - 1)), Int[(b*Csc[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n,
 1] && IntegerQ[2*n]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin {align*} \int \frac {\cos (x)}{\left (a-a \sin ^2(x)\right )^2} \, dx &=\frac {\int \sec ^3(x) \, dx}{a^2}\\ &=\frac {\sec (x) \tan (x)}{2 a^2}+\frac {\int \sec (x) \, dx}{2 a^2}\\ &=\frac {\tanh ^{-1}(\sin (x))}{2 a^2}+\frac {\sec (x) \tan (x)}{2 a^2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(45\) vs. \(2(22)=44\).
time = 0.01, size = 45, normalized size = 2.05 \begin {gather*} \frac {-\log \left (\cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )\right )+\log \left (\cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )\right )+\sec (x) \tan (x)}{2 a^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cos[x]/(a - a*Sin[x]^2)^2,x]

[Out]

(-Log[Cos[x/2] - Sin[x/2]] + Log[Cos[x/2] + Sin[x/2]] + Sec[x]*Tan[x])/(2*a^2)

________________________________________________________________________________________

Maple [A]
time = 0.13, size = 36, normalized size = 1.64

method result size
derivativedivides \(\frac {-\frac {1}{4 \left (1+\sin \left (x \right )\right )}+\frac {\ln \left (1+\sin \left (x \right )\right )}{4}-\frac {1}{4 \left (\sin \left (x \right )-1\right )}-\frac {\ln \left (\sin \left (x \right )-1\right )}{4}}{a^{2}}\) \(36\)
default \(\frac {-\frac {1}{4 \left (1+\sin \left (x \right )\right )}+\frac {\ln \left (1+\sin \left (x \right )\right )}{4}-\frac {1}{4 \left (\sin \left (x \right )-1\right )}-\frac {\ln \left (\sin \left (x \right )-1\right )}{4}}{a^{2}}\) \(36\)
risch \(-\frac {i \left ({\mathrm e}^{3 i x}-{\mathrm e}^{i x}\right )}{\left ({\mathrm e}^{2 i x}+1\right )^{2} a^{2}}-\frac {\ln \left ({\mathrm e}^{i x}-i\right )}{2 a^{2}}+\frac {\ln \left ({\mathrm e}^{i x}+i\right )}{2 a^{2}}\) \(58\)
norman \(\frac {\frac {\tan ^{5}\left (\frac {x}{2}\right )}{a}+\frac {\tan ^{7}\left (\frac {x}{2}\right )}{a}-\frac {\tan \left (\frac {x}{2}\right )}{a}-\frac {\tan ^{3}\left (\frac {x}{2}\right )}{a}}{\left (1+\tan ^{2}\left (\frac {x}{2}\right )\right ) a \left (\tan ^{2}\left (\frac {x}{2}\right )-1\right )^{3}}-\frac {\ln \left (\tan \left (\frac {x}{2}\right )-1\right )}{2 a^{2}}+\frac {\ln \left (\tan \left (\frac {x}{2}\right )+1\right )}{2 a^{2}}\) \(91\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(x)/(a-a*sin(x)^2)^2,x,method=_RETURNVERBOSE)

[Out]

1/a^2*(-1/4/(1+sin(x))+1/4*ln(1+sin(x))-1/4/(sin(x)-1)-1/4*ln(sin(x)-1))

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 41 vs. \(2 (18) = 36\).
time = 0.29, size = 41, normalized size = 1.86 \begin {gather*} -\frac {\sin \left (x\right )}{2 \, {\left (a^{2} \sin \left (x\right )^{2} - a^{2}\right )}} + \frac {\log \left (\sin \left (x\right ) + 1\right )}{4 \, a^{2}} - \frac {\log \left (\sin \left (x\right ) - 1\right )}{4 \, a^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)/(a-a*sin(x)^2)^2,x, algorithm="maxima")

[Out]

-1/2*sin(x)/(a^2*sin(x)^2 - a^2) + 1/4*log(sin(x) + 1)/a^2 - 1/4*log(sin(x) - 1)/a^2

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 37 vs. \(2 (18) = 36\).
time = 0.39, size = 37, normalized size = 1.68 \begin {gather*} \frac {\cos \left (x\right )^{2} \log \left (\sin \left (x\right ) + 1\right ) - \cos \left (x\right )^{2} \log \left (-\sin \left (x\right ) + 1\right ) + 2 \, \sin \left (x\right )}{4 \, a^{2} \cos \left (x\right )^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)/(a-a*sin(x)^2)^2,x, algorithm="fricas")

[Out]

1/4*(cos(x)^2*log(sin(x) + 1) - cos(x)^2*log(-sin(x) + 1) + 2*sin(x))/(a^2*cos(x)^2)

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 117 vs. \(2 (20) = 40\).
time = 0.24, size = 117, normalized size = 5.32 \begin {gather*} - \frac {\log {\left (\sin {\left (x \right )} - 1 \right )} \sin ^{2}{\left (x \right )}}{4 a^{2} \sin ^{2}{\left (x \right )} - 4 a^{2}} + \frac {\log {\left (\sin {\left (x \right )} - 1 \right )}}{4 a^{2} \sin ^{2}{\left (x \right )} - 4 a^{2}} + \frac {\log {\left (\sin {\left (x \right )} + 1 \right )} \sin ^{2}{\left (x \right )}}{4 a^{2} \sin ^{2}{\left (x \right )} - 4 a^{2}} - \frac {\log {\left (\sin {\left (x \right )} + 1 \right )}}{4 a^{2} \sin ^{2}{\left (x \right )} - 4 a^{2}} - \frac {2 \sin {\left (x \right )}}{4 a^{2} \sin ^{2}{\left (x \right )} - 4 a^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)/(a-a*sin(x)**2)**2,x)

[Out]

-log(sin(x) - 1)*sin(x)**2/(4*a**2*sin(x)**2 - 4*a**2) + log(sin(x) - 1)/(4*a**2*sin(x)**2 - 4*a**2) + log(sin
(x) + 1)*sin(x)**2/(4*a**2*sin(x)**2 - 4*a**2) - log(sin(x) + 1)/(4*a**2*sin(x)**2 - 4*a**2) - 2*sin(x)/(4*a**
2*sin(x)**2 - 4*a**2)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 38 vs. \(2 (18) = 36\).
time = 0.45, size = 38, normalized size = 1.73 \begin {gather*} \frac {\log \left (\sin \left (x\right ) + 1\right )}{4 \, a^{2}} - \frac {\log \left (-\sin \left (x\right ) + 1\right )}{4 \, a^{2}} - \frac {\sin \left (x\right )}{2 \, {\left (\sin \left (x\right )^{2} - 1\right )} a^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)/(a-a*sin(x)^2)^2,x, algorithm="giac")

[Out]

1/4*log(sin(x) + 1)/a^2 - 1/4*log(-sin(x) + 1)/a^2 - 1/2*sin(x)/((sin(x)^2 - 1)*a^2)

________________________________________________________________________________________

Mupad [B]
time = 0.08, size = 30, normalized size = 1.36 \begin {gather*} \frac {\mathrm {atanh}\left (\sin \left (x\right )\right )}{2\,a^2}-\frac {\sin \left (x\right )}{2\,\left (a^2\,{\sin \left (x\right )}^2-a^2\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(x)/(a - a*sin(x)^2)^2,x)

[Out]

atanh(sin(x))/(2*a^2) - sin(x)/(2*(a^2*sin(x)^2 - a^2))

________________________________________________________________________________________